home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / examples / doc / plot09 < prev    next >
Text File  |  1997-07-08  |  2KB  |  68 lines

  1. ; This batch file creates window with four plots. It is used as an
  2. ; example inin Chapter 10, "Plotting", of _Using IDL_.
  3.  
  4. ; Define 12 monthly precipitation values, average temperatures, names
  5. ; of months, and create a vector containing approximate day number of
  6. ; the middle of each month.
  7.  
  8. PRECIP=[0.5,0.7,1.2,1.8,2.5,1.6,1.9,1.5,1.2,1.0,0.8,0.6]
  9.  
  10. TEMP=[30, 34, 38, 47, 57, 67, 73, 71, 63, 52, 39, 33]
  11.  
  12. MONTH=['Ja', 'Fe', 'Ma', 'Ap', 'Ma', 'Ju', 'Ju', 'Au', 'Se', 'Oc', 'No', 'De']
  13.  
  14. DAY=FINDGEN(12) * 30 + 15
  15.  
  16. ; Set up for 4 plots in the window, increasing bottom outer margin.
  17.  
  18. !P.MULTI=[0,2,2]
  19. !Y.OMARGIN=[1,0]
  20.  
  21. ; Plot #1: Upper left.
  22. ; Plot, setting tick-mark length to full and setting number, position, 
  23. ; and labels of ticks.
  24.  
  25. PLOT, DAY, PRECIP, XTICKS = 11, XTICKNAME = MONTH, $
  26.     TICKLEN = 1.0, XTICKV = DAY, TITLE = 'Average Monthly Precipitation', $
  27.     XTITLE = 'Inches', SUBTITLE = 'Denver'
  28.  
  29. ; Plot #2: Upper right.
  30. ; Same plot as above, but with tick-marklength set to a negative
  31. ; value for outside ticks.
  32.  
  33. PLOT, DAY, PRECIP, XTICKS = 11, XTICKNAME = MONTH, $
  34.     TICKLEN = -0.02, XTICKV = DAY, TITLE = 'Average Monthly Precipitation', $
  35.     XTITLE = 'Inches', SUBTITLE = 'Denver'
  36.  
  37. ; Plot #3: Lower left.
  38. ; Set XSTYLE and YSTYLE keyword equal to 8 to inhibit drawing the box-style
  39. ; axes - only the left and bottom sides are drawn. We will draw the top and
  40. ; right axes explicitly, using the AXIS command.
  41.  
  42. PLOT, DAY, TEMP, /YNOZERO, SUBTITLE = 'Denver Average Temperature', $
  43.     XTITLE = 'Day of Year', YTITLE = 'Degrees Fahrenheit', $
  44.     XSTYLE=8, YSTYLE=8, XMARGIN=[8, 8], YMARGIN=[4, 4]
  45.  
  46. AXIS, XAXIS=1, XTICKS=11, XTICKV=DAY, XTICKN=MONTH, XTITLE='Month', charsize=0.8
  47.  
  48. AXIS, YAXIS=1, YRANGE = (!Y.CRANGE-32)*5./9., YSTYLE = 1, $
  49.    YTITLE = 'Degrees Celsius'
  50.     
  51. ; Plot #4: Lower right.
  52. ; This time, we suppress the automatic axis drawing entirely by setting
  53. ; XSYTLE and YSTYLE equal to 4. The central axes are drawn explicitly
  54. ; with two calls to the AXIS procedure.
  55.  
  56. R = FINDGEN(100)        ;Make a radius vector.
  57. THETA = R/5             ;Make a vector.
  58.  
  59. PLOT, R, THETA, SUBTITLE='Polar Plot!3', XSTYLE=4, YSTYLE=4, /POLAR
  60.  
  61. AXIS, 0, 0, XAXIS=0
  62. AXIS, 0, 0, YAXIS=0
  63.     
  64. ; Reset number of plots and outer margin.
  65.  
  66. !P.MULTI = 0
  67. !Y.OMARGIN=[0,0]
  68.